﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Data.OracleClient;
using DreamBuilder.Common;

namespace Web.SystemConfig.DataAccess
{
    class DALAuth_Data : DataAccessBase
    {
        internal DataTable GetAuth_DataInfo(string menu_ID)
        {
            DbParameter[] arrParam;
            string strSql = string.Empty;
            if (DBHelper.database is Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase)
            {
                arrParam = new DbParameter[] {
                    new OracleParameter(":Menu_ID", menu_ID) 
                };
                strSql = "SELECT * FROM P_Auth_Data_Row where Menu_ID=:Menu_ID ";
            }
            else
            {
                arrParam = new DbParameter[] {
                    new SqlParameter("@Menu_ID", menu_ID)
                };
                strSql = "SELECT * FROM P_Auth_Data_Row where Menu_ID=@Menu_ID ";
            }
            return DBHelper.ExecuteDataSet(strSql, arrParam).Tables[0];
        }
    }
}
